home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_bas / qbsvga.zip / SIM.BAS < prev    next >
BASIC Source File  |  1996-04-22  |  3KB  |  91 lines

  1. '
  2. '  This is a simple routine that may aid in seeing how to use the QBSVGA
  3. ' routines and where to put REGTYPE.INC.  If you go to compile and link
  4. ' it, use QB.LIB (in addition to whatever other libraries you would
  5. ' normally use).  This applies anytime you use the QBSVGA routines.
  6. ' Similarly, if you're going to use these routines from within the QB
  7. ' IDE, run QB with the "/L" command-line option.
  8. '
  9. '  Put the contents of REGTYPE.INC here.
  10. '
  11.     CALL BSCREEN(15!,7!,1!,1!,INREGS,OUTREGS)
  12.     CALL BLINE(10!,10!,790!,590!,14!,"BF",INREGS,OUTREGS)
  13.     CALL BCIRCLE(400!,300!,290!,13!,0!,0!,1!,INREGS,OUTREGS)
  14.     CALL BCIRCLE(400!,300!,150!,12!,0!,1.57!,1!,INREGS,OUTREGS)
  15.     S=3.141593
  16.     E=3*3.141593/2
  17.     CALL BCIRCLE(400!,300!,150!,11!,S,E,1!,INREGS,OUTREGS)
  18.     CALL BLINE(30!,30!,30!,350!,15!,"L",INREGS,OUTREGS)
  19.     CALL BCOLOR(12!)
  20. '
  21. '  A negative number input to any of the QBSVGA routines for the color
  22. ' will be reset to the default color defined in the call to BSCREEN
  23. ' (or COLOR).  (An exception to this is BVIEW; it uses color 0 in this
  24. ' situation.)
  25. '
  26.     CALL BLINE(0!,0!,799!,599!,-1!,"L",INREGS,OUTREGS)
  27.     CALL BCOLOR(9!)
  28.     CALL BLOCATE(30!,10!,INREGS,OUTREGS)
  29.     CALL BPRINT("This is an example.",INREGS,OUTREGS)
  30.     PCOLOR=BPOINT(799!,599!,INREGS,OUTREGS)
  31.     CALL BLOCATE(3!,3!,INREGS,OUTREGS)
  32.     A$="Color of pixel at (800,600) is "+LTRIM$(RTRIM$(STR$(PCOLOR)))+";"
  33.     CALL BPRINT(A$,INREGS,OUTREGS)
  34.     CALL BPRINT("    (Wait...)",INREGS,OUTREGS)
  35.     RX=799
  36.     RY=599
  37.     CALL BLINE(0!,0!,RX,RY,10!,"B",INREGS,OUTREGS)
  38.     SLEEP 5
  39.     CALL BSCREEN(14!,6!,1!,1!,INREGS,OUTREGS)
  40.     CALL BLOCATE(1!,3!,INREGS,OUTREGS)
  41.     CALL BPRINT("Now I am going to use a graphics viewport;",INREGS,OUTREGS)
  42.     CALL BPRINT(" in a different screen mode.",INREGS,OUTREGS)
  43.     CALL BPRINT(" ",INREGS,OUTREGS)
  44.     CALL BPRINT("(Wait...)",INREGS,OUTREGS)
  45.     CALL BVIEW(40!,60!,230!,250!,0!,7!,INREGS,OUTREGS)
  46.     CALL BCIRCLE(100!,120!,40!,7!,0!,0!,2!,INREGS,OUTREGS)
  47. '
  48. '  Paint inside of circle.
  49. '
  50.     CALL BPAINT(100!,120!,11!,-1!,INREGS,OUTREGS)
  51. '
  52. '  Paint top, bottom, and righthand portions of exterior of circle.
  53. '
  54.     CALL BPAINT(141!,120!,13!,-1!,INREGS,OUTREGS)
  55. '
  56. '  Paint remaining portion of circle exterior.
  57. '
  58.     CALL BPAINT(59!,120!,13!,-1!,INREGS,OUTREGS)
  59.     SLEEP 5
  60.     CALL BCLS(0!,INREGS,OUTREGS)
  61.     CALL BLOCATE(1!,10!,INREGS,OUTREGS)
  62.     A$="Now I'm going to try to print 256 colors in that last graphics mode."
  63.     CALL BPRINT(A$,INREGS,OUTREGS)
  64.     CALL BLOCATE(3!,1!,INREGS,OUTREGS)
  65.     C=0
  66.     FOR I=33 TO 126
  67.     CALL BCOLOR(C)
  68.     CALL BPRINT(CHR$(I)+";",INREGS,OUTREGS)
  69.     C=C+1
  70.     NEXT I
  71.     FOR I=33 TO 126
  72.     CALL BCOLOR(C)
  73.     CALL BPRINT(CHR$(I)+";",INREGS,OUTREGS)
  74.     C=C+1
  75.     NEXT I
  76.     FOR I=33 TO 100
  77.     CALL BCOLOR(C)
  78.     CALL BPRINT(CHR$(I)+";",INREGS,OUTREGS)
  79.     C=C+1
  80.     NEXT I
  81.     CALL BPRINT(" ",INREGS,OUTREGS)
  82.     CALL BCOLOR(7!)
  83.     CALL BPRINT(" ",INREGS,OUTREGS)
  84.     CALL BPRINT(" ",INREGS,OUTREGS)
  85.     CALL BPRINT("Press a key to quit.",INREGS,OUTREGS)
  86. 270 IF INKEY$="" THEN GOTO 270
  87.     CALL BSCREEN(0!,7!,1!,1!,INREGS,OUTREGS)
  88.     END
  89. '
  90. '  Put the contents of QBSVGA.BAS here.
  91.